***LI_2020_CIE
///目录
表1  主要变量的基本统计特征
表2  金融科技发展分年份和地区的趋势变化
表3  基准回归结果
表4  工具变量的回归结果
表5  剔除样本期内从未申请专利的企业的稳健性检验
表6  考虑金融发展水平的稳健性检验
表7  基于研发支出的稳健性检验
表8  基于非线性模型的稳健性检验
表9  机制分析结果
表10 异质性分析结果

***表1 主要变量的基本统计特征
 using baseline clear ///可以对比一下几种数据的不同排列方式

 ssc install sum2docx, replace
 sum2docx Patent Patent_R Patent1 Patent2 Fintech Fintech_R Size LEV Growth CapEx PPE ///
	Indep GDP Population using table1.docx, replace ///
	stats(N mean(%9.4f) sd(%9.4f) min(%9.4f) median(%9.4f) max(%9.4f)) ///
	title("表1：主要变量的基本统计特征")
 /// sum的命令
 outreg2 using xxx.doc, replace sum(log) keep( Patent Patent_R Patent1 Patent2  ///
	     Fintech Fintech_R Size LEV Growth CapEx PPE Indep GDP Population ) ///
		 title(Decriptive statistics)
		 
***表2 金融科技发展分年份和地区的趋势变化--stata版本得17以上才能出表格
 ssc install report, replace
 report, rows(Fintech, count | Fintech, mean %9.4f) cols(year) rowsby(region) ///
	file(实证结果) title(表2：金融科技发展分年份和地区的趋势变化)
	
***表3 基准回归结果
 xtreg Patent Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry, ///
       fe vce(cluster city)
 est store m1
 ///固定年度和行业时“#”的差异导致系数发生轻微变化--增加了0.008
 xtreg Patent1 Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year#i.industry, ///
        fe vce(cluster city)
 xtreg Patent1 Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry,///
       fe vce(cluster city)
 est store m2
 
 xtreg Patent2 Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry, ///
       fe vce(cluster city)
 xtreg Patent2 Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year#i.industry, ///每次系数都增加0.008
       fe vce(cluster city)
 est store m3
 
 ssc install reg2docx, replace
 reg2docx m1 m2 m3 using table3.docx, replace indicate("年份*行业=*#*industry") /// 表示用yes no 来表示是否控制
           mtitles("专利总产出(Patent)" "发明专利(Patent1)" "非发明专利(Patent2)")/// 每一列的标题
           scalars(N r2_w(%9.4f)) b(%9.4f) t(%9.4f) title("表3：基准回归结果")

***表4 工具变量的回归结果
using IV
xtset code year
xtivreg Patent (Fintech = FintechIV) Size LEV Growth CapEx PPE Indep GDP Population ///
        i.yeari.industry, fe vce(cluster city)
		
 xtivreg Patent (Fintech = FintechIV) Size LEV Growth CapEx PPE Indep GDP Population ///
	    i.year#i.industry, fe vce(cluster city)
		
 est store m1
///结果仍有细微差别, 采用不加#的结果
xtivreg Patent1 (Fintech = FintechIV) Size LEV Growth CapEx PPE Indep GDP Population ///
        i.year#i.industry, fe vce(cluster city)
		
xtivreg Patent1 (Fintech = FintechIV) Size LEV Growth CapEx PPE Indep GDP Population///
        i.year i.industry, fe vce(cluster city)
		
est store m2
///结果差别
xtivreg Patent2 ( Fintech = FintechIV) Size LEV Growth CapEx PPE Indep GDP Population///
        i.year#i.industry, fe vce(cluster city)

xtivreg Patent2 ( Fintech = FintechIV) Size LEV Growth CapEx PPE Indep GDP Population///
        i.year i.industry, fe vce(cluster city)
		
est store m3

reg2docx m1 m2 m3 using table4.docx, replace indicate("年份*行业=*#*industry") ///
	    mtitles("专利总产出(Patent)" "发明专利(Patent1)" "非发明专利(Patent2)") scalars(N) ///
	    b(%9.4f) z(%9.4f) noconstant title("表4：工具变量回归结果")
		
***表5 剔除样本期内从未申请专利的企业的稳健性检验
using robust1
xtset code year
xtreg Patent Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year#i.industry,///
      fe vce(cluster city)
xtreg Patent Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry,///
      fe vce(cluster city)
est store m1

xtreg Patent1 Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year#i.industry, ///
      fe vce(cluster city)
xtreg Patent1 Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry,///
      fe vce(cluster city)
est store m2
 
xtreg Patent2 Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year#i.industry,///
      fe vce(cluster city)
xtreg Patent1 Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry,///
      fe vce(cluster city)
est store m3

reg2docx m1 m2 m3 using table5.docx, replace indicate("年份*行业=*#*industry")///
	    mtitles("专利总产出(Patent)" "发明专利(Patent1)" "非发明专利(Patent2)")///
	    scalars(N r2_w(%9.4f)) b(%9.4f) t(%9.4f) noconstant///
	    title("表5：剔除样本期内从未申请专利的企业的稳健性检验")

***表6 考虑金融发展水平的稳健性检验
xtset code year
xtreg Patent Fintech Branch Size LEV Growth CapEx PPE Indep GDP Population///
      i.year#i.industry, fe vce(cluster city)
xtreg Patent Fintech Branch Size LEV Growth CapEx PPE Indep GDP Population///
      i.year i.industry, fe vce(cluster city)
est store m1

xtreg Patent1 Fintech Branch Size LEV Growth CapEx PPE Indep GDP Population///
     i.year#i.industry, fe vce(cluster city)
xtreg Patent1 Fintech Branch Size LEV Growth CapEx PPE Indep GDP Population///
     i.year i.industry, fe vce(cluster city)
est store m2

xtreg Patent2 Fintech Branch Size LEV Growth CapEx PPE Indep GDP Population///
 i.year#i.industry, fe vce(cluster city)
 xtreg Patent2 Fintech Branch Size LEV Growth CapEx PPE Indep GDP Population///
 i.year i.industry, fe vce(cluster city)
 est store m3
 
 reg2docx m1 m2 m3 using table6.docx, replace indicate("年份*行业=*#*industry")///
	    mtitles("专利总产出(Patent)" "发明专利(Patent1)" "非发明专利(Patent2)")///
	    scalars(N r2_w(%9.4f)) b(%9.4f) t(%9.4f) noconstant///
	    title("表5：剔除样本期内从未申请专利的企业的稳健性检验")

***表7 基于研发支出的稳健性检验
xtset code year
///只控制了控制变量，不对企业个体、行业和时间进行固定
reg Patent RD_Sales Size LEV Growth CapEx PPE Indep GDP Population , vce(cluster city)
est store m1
///固定了个体
xtreg RD_Sales Fintech Size LEV Growth CapEx PPE Indep GDP Population, fe vce(cluster city)
est store m2
///固定了企业个体、行业和时间
xtreg RD_Sales Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year#i.industry, fe vce(cluster city)
xtreg RD_Sales Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry, fe vce(cluster city)
est store m3

reg2docx m1 m2 m3 using table7.docx, replace indicate("年份*行业=*#*industry")///
	    mtitles("专利总产出(Patent)" "发明专利(Patent1)" "非发明专利(Patent2)")///
	    scalars(N r2_w(%9.4f)) b(%9.4f) t(%9.4f) noconstant///
	    title("表5：剔除样本期内从未申请专利的企业的稳健性检验")
		
***表8  基于非线性模型的稳健性检验
using robust4
xtset code year
///断点回归，0&1采用
logit Patent_R Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry i.city, vce(cluster city)
est store m1

tobit Patent_R Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry i.city, vce(cluster city) ll(0)
est store m2

poisson Patent_R Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry i.city, vce(cluster city)
est store m3

reg2docx m1 m2 m3 using table8.docx, replace indicate("年份*行业=*#*industry")///
	    mtitles("专利总产出(Patent)" "发明专利(Patent1)" "非发明专利(Patent2)")///
	    scalars(N r2_w(%9.4f)) b(%9.4f) t(%9.4f) noconstant///
	    title("表5：剔除样本期内从未申请专利的企业的稳健性检验")
		
using robust5
xtset code year

logit Patent_R Fintech RD_Sales Size LEV Growth CapEx PPE Indep GDP Population i.year ///
	i.industry i.city, vce(cluster city)
est store m1

tobit Patent_R Fintech RD_Sales Size LEV Growth CapEx PPE Indep GDP Population i.year ///
	i.industry i.city, vce(cluster city) ll(0)
est store m2

poisson Patent_R Fintech RD_Sales Size LEV Growth CapEx PPE Indep GDP Population i.year ///
	i.industry i.city, vce(cluster city)
est store m3

reg2docx m1 m2 m3 using table8.docx, append ///
	indicate("年份=*year" "行业=*industry" "城市=*city") mtitles("Logit" "Tobit" "Poisson") ///
	scalars(N r2_p(%9.4f)) b(%9.4f) t(%9.4f) noconstant ///
	title("表8：控制滞后一期研发支出的稳健性检验")

***表9 
using channel.11

xtset code year
xtreg FC Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year#i.industry, fe vce(cluster city)
xtreg FC Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry, fe vce(cluster city)
est store m1

xtreg Patent FC Size LEV Growth CapEx PPE Indep GDP Population i.year#i.industry, fe vce(cluster city)
xtreg Patent FC Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry, fe vce(cluster city)
est store m2
///金融科技影响融资约束 融资约束影响企业创新

xtreg Patent Fintech FC FC_Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year#i.industry, fe vce(cluster city)
xtreg Patent Fintech FC FC_Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry, fe vce(cluster city)
est store m3

reg2docx m1 m2 m3 using 实证结果.docx, append indicate("年份*行业=*#*industry") ///
	mtitles("融资约束(FC)" "专利总产出(Patent)" "专利总产出(Patent)") ///
	order(Fintech FC FC_Fintech) scalars(N r2_w(%9.4f)) b(%9.4f) t(%9.4f) ///
	noconstant title("表10：基于融资约束的机制分析")
	
using channel 2
xtset code year
xtreg Patent Fintech Subsidy Fintech_Subsidy Size LEV Growth CapEx PPE Indep GDP Population i.year#i.industry, fe vce(cluster city)
xtreg Patent Fintech Subsidy Fintech_Subsidy Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry, fe vce(cluster city)
est store m1

xtreg Patent TaxRebate Fintech_TaxRebate Size LEV Growth CapEx PPE Indep GDP Population i.year#i.industry, fe vce(cluster city)
xtreg Patent TaxRebate Fintech_TaxRebate Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry, fe vce(cluster city)
est store m2

reg2docx m1 m2 using table9.1.docx, replace indicate("年份*行业=*#*industry") ///
	mtitles("专利总产出(Patent)" "专利总产出(Patent)") ///
	order(Fintech Subsidy Fintech_Subsidy TaxRebate Fintech_TaxRebate) ///
	scalars(N r2_w(%9.4f)) b(%9.4f) t(%9.4f) noconstant ///
	title("表10：基于政府补助和税收返还的机制分析")
	
***表10 异质性分析
using heterogeneity
xtset code year
xtreg Patent Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year#i.industry ///
	if EastArea == 1, fe vce(cluster city)
	xtreg Patent Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry ///
	if EastArea == 1, fe vce(cluster city)
est store m1
xtreg Patent Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year#i.industry ///
	if EastArea == 0, fe vce(cluster city)
	xtreg Patent Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year#i.industry ///
	if EastArea == 0, fe vce(cluster city)
est store m2

xtreg Patent Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year#i.industry ///
	if HighTech == 1, fe vce(cluster city)
xtreg Patent Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry ///
	if HighTech == 1, fe vce(cluster city)
est store m3
xtreg Patent Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year#i.industry ///
	if HighTech == 0, fe vce(cluster city)
xtreg Patent Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year i.industry ///
	if HighTech == 0, fe vce(cluster city)
est store m4

reg2docx m1 m2 m3 m4 using table10.docx, replace indicate("年份*行业=*#*industry") ///
	mtitles("东部地区" "中西部地区" "高科技行业" "非高科技行业") scalars(N r2_w(%9.4f)) ///
	b(%9.4f) t(%9.4f) title("表10：异质性分析结果")




